package Homework.Top01.Test;

import java.util.Scanner;

public class ShoppingTest {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        Shopping shopping=new Shopping();
        shopping.name="永辉超市";
        shopping.address="合肥市宣城路111号";
        while (true){
            System.out.println("0.新会员加入\t1.积分累加\t2.积分兑换\t3.显示本店会员信息\t4.退出");
            int choice=in.nextInt();
            if (choice==0){
                System.out.println("请输入姓名：");
                String name=in.next();
                System.out.println("请输入创建的会员号：");
                String vNum=in.next();
                System.out.println("请输入电话：");
                String phone=in.next();
                System.out.println("请输入本次积分：");
                int integral=in.nextInt();
                Vip vip=new Vip(vNum,name,phone,integral);
                String print=shopping.addvip(vip)?"添加成功":"添加失败";
            }else if (choice==1){
                System.out.println("请输入要添加积分的会员号：");
                String vnum=in.next();
                System.out.println("请输入要本次要添加的积分：");
                int integral=in.nextInt();
                shopping.inc(vnum,integral);
                 int addintegral=in.nextInt();
            }else if (choice==3){
                shopping.printInfo();
            }else if (choice==4){
                break;
            }else if (choice==2){
                System.out.println("请输入需要兑换的会员号：");
                String vipnum = in.next();
                System.out.println("请输入想要兑换的奖品序号:\n1：100分兑换餐巾纸一包 \n2:400分兑换剃须刀一把 \n3：1000分兑换炒锅一个");
                int duihuan = in.nextInt();
                shopping.exchange(vipnum,duihuan);
            }
        }
    }
}
